<html>
<head><meta charset="utf-8"><title>dump Debug MIR · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dump.20Debug.20MIR.html">dump Debug MIR</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="223725855"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dump%20Debug%20MIR/near/223725855" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dump.20Debug.20MIR.html#223725855">(Jan 23 2021 at 02:08)</a>:</h4>
<p>Is there a way to easily dump the <code>Debug</code> version of the MIR? I.e., the internal representation, not the pretty-printed version.</p>



<a name="223726594"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dump%20Debug%20MIR/near/223726594" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dump.20Debug.20MIR.html#223726594">(Jan 23 2021 at 02:26)</a>:</h4>
<p>(Feel free to ping me if you respond so that I don't forget that I asked this <span aria-label="smile" class="emoji emoji-1f642" role="img" title="smile">:smile:</span>)</p>



<a name="223738806"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dump%20Debug%20MIR/near/223738806" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dump.20Debug.20MIR.html#223738806">(Jan 23 2021 at 08:36)</a>:</h4>
<p><span class="user-mention" data-user-id="307537">@Camelid</span> The <code>Debug</code> impl of several MIR types (including <code>Statement</code> I think) always shows the pretty-printed version.</p>



<a name="223772873"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dump%20Debug%20MIR/near/223772873" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dump.20Debug.20MIR.html#223772873">(Jan 23 2021 at 20:10)</a>:</h4>
<p>Oh, then is there some way to view the non-pretty-printed output? It's sometimes hard to tell how something is represented internally from looking at the pretty-printed output.</p>



<a name="223773695"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dump%20Debug%20MIR/near/223773695" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dump.20Debug.20MIR.html#223773695">(Jan 23 2021 at 20:28)</a>:</h4>
<p>I don't think so.</p>



<a name="223773706"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dump%20Debug%20MIR/near/223773706" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dump.20Debug.20MIR.html#223773706">(Jan 23 2021 at 20:29)</a>:</h4>
<p><span class="user-mention" data-user-id="307537">@Camelid</span> ^</p>



<a name="223778679"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dump%20Debug%20MIR/near/223778679" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dump.20Debug.20MIR.html#223778679">(Jan 23 2021 at 21:50)</a>:</h4>
<p>You're right about <code>Statement</code>'s Debug impl being pretty-printing, but it looks like <code>Body</code> and <code>BasicBlockData</code> use <code>#[derive(Debug)]</code>. Maybe I could add some kind of flag to dump that instead...</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>